package multitester.myapp;

import org.easymock.EasyMock;

/**
 * @author Yuriy Sechko
 */
public class AnnieStub implements IStub
{
	private String phrase;

	// Use this field for checking whether specific method was called or not.
	// EasyMock library helps to track it.
	public final EasymockStub mockForCheckingSetPhraseCall = EasyMock
			.createStrictMock(EasymockStub.class);

	public void setPhrase(final String phrase)
	{
		mockForCheckingSetPhraseCall.setPhrase();
		this.phrase = phrase;
	}

	public String say(final String whatToSay)
	{
		if (whatToSay == null)
		{
			throw new IllegalArgumentException("whatToSay should not be null.");
		}
		return whatToSay + phrase.toString();
	}

	public void doSecondJob()
	{

	}

	public void close()
	{
		// mockForCheckingCloseCall.close();
	}
}
